<?php
/**
 * +--------------------------------------------------------+
 * @Created by Phpstorm.
 * @Category YbsArticleCommand.php
 * @Depiction
 * @Author hwy <429208948@qq.com>
 * @Date 2021/8/19  14:08
 * +--------------------------------------------------------+
 */

namespace App\Console\Commands;


use App\Services\StockArticleService;
use Illuminate\Console\Command;

class YbsArticleCommand extends Command
{
    /**
     * The name and signature of the console command.
     *
     * @var string
     */
    protected $signature = 'command:ybsarticle';

    /**
     * The console command description.
     *
     * @var string
     */
    protected $description = '采集研报社数据';

    protected $stockArticleService;

    /**
     * Create a new command instance.
     *
     * @return void
     */
    public function __construct(StockArticleService $stockArticleService)
    {
        $this->stockArticleService = $stockArticleService;
        parent::__construct();
    }

    /**
     * Execute the console command.
     *
     * @return mixed
     */
    public function handle()
    {
        $this->info("获取开始..." . date('Y-m-d H:i:s'));

        $this->stockArticleService->collectYbsArticle();

        $this->info("获取结束..." . date('Y-m-d H:i:s'));
    }
}
